<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "{{%order_detail}}".
 *
 * @property integer $id
 * @property string $orderId
 * @property integer $hyId
 * @property integer $goodsId
 * @property string $title
 * @property string $img
 * @property string $price
 * @property integer $quantity
 * @property integer $uid
 */
class OrderDetail extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%order_detail}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['orderId', 'hyId', 'goodsId', 'quantity', 'uid'], 'required'],
            [['hyId','supId' ,'goodsId', 'quantity', 'uid','qym','cs','xj'], 'integer'],
            [['price'], 'number'],
            [['orderId'], 'string', 'max' => 50],
            [['title', 'img','gg'], 'string', 'max' => 255]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'orderId' => '订单编号',
            'hyId' => '货源ID',
            'supId'=>'供应商id',
            'goodsId' => '商品ID',
            'title' => '商品名称',
            'img' => '图片路径',
            'price' => '单价',
            'quantity' => '购买数量',
            'qym'=>'区域码',
            'xj'=>'新旧',
            'cs'=>'是否残损',
            'uid' => 'Uid',
        ];
    }
}
